<!DOCTYPE html>
<html lang="en">

<head>
	<{include file="header.html" }>
		<title>学员管理-
			<{$user_data[ 'school_name']}>-德安信会计在线教育平台</title>
</head>

<body>
	<div class="wrap">
		<!--star left-->
		<div class="column">
			<{include file="left_menu.html" }>
		</div>
		<div id="ContMianBox">

			<!--star子栏目-->
			<div class="sub-colum">
                <div class="tit"><{$left_menu_min.menu}></div>
                <ul>
                    <{foreach from=$left_menu_min.list item=item}>
                    <li <{if $item['url'] == $left_menu_min.curr}>class="curr"<{/if}>><a href="<{$item['url']}>"><{$item['name']}></a></li>
                    <{/foreach}>
                </ul>
            </div>
			<!--end子栏目-->

			<!--end left-->
			<div class="container narrow">
				<!--star conter-->
				<div class="cetContent">
					<div class="tit p-lr20">
						<span class="curr">学员管理</span>
					</div>

					<!--star内容区域-->
					<div class="mainScroll">
						<div class="mainContainer line-all">
							<!--star tabMainCont-->
							<div class="tabMainCont">

								<fieldset class="layui-elem-field">
									<legend>筛选</legend>
									<div class="layui-field-box">
										<form class="layui-form layui-form-pane1" method="post">
											<div class="layui-form-item">
                                                <div class="layui-inline">
														<input type="text" name="name" value="<{if !empty($conditions.name)}><{$conditions.name}><{/if}>" placeholder="学员姓名" autocomplete="off" class="layui-input">
												</div>
												<div class="layui-inline">
                                                    <select name="school_campus_id">
                                                        <option value="" >校区筛选</option>
                                                        <{foreach from=$campus_list item=item}>
                                                            <option value="<{$item.id}>" <{if isset($conditions.school_campus_id) && $item.id==$conditions.school_campus_id}>selected=selected<{/if}>><{$item.name}></option>
                                                        <{/foreach}>
                                                    </select>
                                                </div>
                                                <div class="layui-inline">
														<input type="text" name="mobile" value="<{if !empty($conditions.mobile)}><{$conditions.mobile}><{/if}>" placeholder="手机号码" autocomplete="off" class="layui-input">
												</div>
                                            </div>
											<div class="layui-form-item">
                                                <div class="layui-inline">
                                                    <input type="text" name="st" placeholder="开始日"  class="layui-input" value='<{if $conditions['st'] != 0}><{$conditions['st']}><{/if}>' id="LAY_demorange_s">
                                                </div>
                                                <div class="layui-inline">
                                                    <input type="text" name="et" placeholder="截止日"  class="layui-input" value='<{if $conditions['et'] != 0}><{$conditions['et']}><{/if}>' id="LAY_demorange_e">
                                                </div>
												<div class="layui-inline">
													<button type="submit" class="layui-btn">搜索</button>
													<a class="layui-btn" href="/student/add"><i class="layui-icon"></i> 新增学员</a>
												</div>

											</div>

										</form>
									</div>
								</fieldset>
								<!--商品列表 star-->
								<div class="goods_list p-t10">
									<div class="mtc_tab">
										<!--star mt-->
										<div class="mt">
											<span class="l fs16">状态：</span>
											<a href="javascript:;" class="curr">全部</a>
											<a href="/student/undistributed">待分班学员</a>
											<!-- <a href="javascript:;">已结业</a> -->

										</div>
										<!--end mt-->
										<!--star mc-->
										<div class="mc">

											<div class="u_table_list m-t20">
												<!--star 商品-->
												<div class="table002">
													<table class="layui-table" lay-skin="line">
														<colgroup>
															<!-- <col width="%"> -->
															<col width="%">
															<col width="%">
															<col width="%">
															<col width="%">
															<col width="%">
															<col width="%">
														</colgroup>
														<tbody>
															<tr>
																<!-- <th>学员编号</th> -->
																<th>学员姓名</th>
																<th>联系电话</th>
																<th>校区</th>
																<th>面授课</th>
																<th>未分班</th>
																<th>加入时间</th>
																<th>来源</th>
																<th>学员评分</th>
																<th>报读科目</th>
																<th>操作</th>
															</tr>
														</tbody>
														<tbody>
															<{foreach from=$student item=item}>
																<tr>
																	<!-- <td class="not_lb tal">
																		<{$item[ 'student_id']}>
																	</td> -->
																	<td class="not_lb tal">
																	<{$item[ 'name']}>
																	</td>
																	<td class="not_lb tal"><span class="c-ff6d5e"><{$item[ 'mobile']}></span></td>

																	<td class="not_lb tal">
																	<{$item[ 'campus_name']}>
																	</td>

																	<td class="not_lb tal"><{$item['kemu']}></td>
																	<td class="not_lb tal"><span class="c-ff6d5e"><{$item['kemu_not']}></span></td>
																	<td class="not_lb tal">
																		<{$item[ 'add_time']|date_format: '%Y-%m-%d'}>
																	</td>
																	<td class="not_lb tal">
																	<{if $item['from']==0}>
																	线上
																	<{elseif $item['from']==1}>
																	线下
																	<{/if}>
																	</td>
																	<td class="not_lb tal">

																		<div class="colorBtn">
																		<p>
																		<span><{$item['score']}></span>
																		<a student_id="<{$item[ 'student_id']}>" class="score" href="javascript:void(0);">修改评分</a></p>
																		</div>
																	</td>
																	<td class="not_lb tal">
																		<div class="colorBtn">
																			<p><a href="/student/subject_list/<{$item['student_id']}>">报读科目</a></p>
																		</div>
																	</td>
																	<td class="not_lb tal">
																		<div class="colorBtn">
																			
																			<p><a href="/student/change_pwd/<{$item['user_id']}>">修改密码</a></p>
																		</div>
																	</td>
																</tr>
																<{/foreach}>
														</tbody>
													</table>
												</div>
												<!--end 商品-->
											</div>
											<div class="pages p-tb20 hide" style="text-align:right;">
												<div class="l">
													<a href="javascript:;" class="zent-btn">未知按钮</a>
													<a href="javascript:;" class="zent-btn">未知按钮</a>
													<a href="javascript:;" class="zent-btn">未知按钮</a>
													<a href="javascript:;" class="zent-btn">未知按钮</a>
												</div>
												<ul>
													<li><a>上一页</a></li>
													<li><a>1</a></li>
													<li class="active"><a>2</a></li>
													<li><a>3</a></li>
													<li><a>4</a></li>
													<li>...</li>
													<li><a>100</a></li>
													<li><a>下一页</a></li>
												</ul>
												<form>
													共100页到第
													<input type="text" value="1" class="inputwh"> 页
												</form>
											</div>
										</div>
										<!--end mc-->
									</div>

								</div>
								<!--商品列表 end -->
							</div>
							<!--end tabMainCont-->
						</div>

					</div>
				</div>
				<!--end内容区域-->

				<!--end conter-->
			</div>


		</div>
	</div>
	<{include file="footer.html"}>
	<div id="score_box" style="padding: 10px; display: none;">
		<div class="layui-form-item">
            <div class="layui-inline">
				<input type="text" id="score" value="<{if !empty($conditions.name)}><{$conditions.name}><{/if}>" placeholder="分数" autocomplete="off" class="layui-input">
			</div>

            <div class="layui-inline">
				<textarea placeholder="评语" id="content" style="width: 340px;" class="layui-textarea"><{if isset($learn_what)}><{$learn_what}><{/if}></textarea>
			</div>
        </div>
        <div class="layui-form-item">
        	<div class="layui-inline">
				<button type="submit" id="sub_score" class="layui-btn">确定</button>
			</div>
        </div>
	</div>
	<script>

		$(".score").click(function(){
            var _this = $(this);
            var student_id = $(this).attr("student_id");
            var index = layer.open({
		  		type: 1,
		  		resize: false,
			  	content: $('#score_box') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
			});
			$("#score").val($(this).prev("span").html())

			$("#sub_score").click(function(){
				var score = $("#score").val();
				var content = $("#content").val();
				if(isNaN(score)){
	                layer.msg("必须是数字！", {icon:5, anim: 6});
	                return false;
	            }
	            if(score <= 0 || score > 100){
	            	layer.msg("评分必须大于1小于100", {icon:5, anim: 6});
	                return false;
	            }
				$.ajax({
                    type: "POST",
                    url: "/student/update_score",
                    dataType:"json",
                    data:{'student_id':student_id, 'score':score, 'content':content},
                    success: function(result){
                        // layer.close(ii);
                        if(result.error == 0){
                        	layer.close(index)
                            layer.msg(result.msg, {icon:6});
                            _this.text(result.msg);
                            _this.prev("span").html(score);
                            // _this.unbind("click");
                        }else{
                            layer.msg(result.msg, {icon:5});
                        }
                    }
                });
			})
        })
	</script>
	<script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;

            var start = {
                min: '2016-11-31 23:59:59',
                max: laydate.now(+1),
                istoday: false,
                choose: function(datas) {
                    end.min = datas; //开始日选好后，重置结束日的最小日期
                    end.start = datas //将结束日的初始值设定为开始日
                }
            };

            var end = {
                min: '2016-11-31 23:59:59',
                max: laydate.now(+1),
                istoday: false,
                choose: function(datas) {
                    start.max = datas; //结束日选好后，重置开始日的最大日期
                }
            };

            document.getElementById('LAY_demorange_s').onclick = function() {
                start.elem = this;
                laydate(start);
            }
            document.getElementById('LAY_demorange_e').onclick = function() {
                end.elem = this
                laydate(end);
            }

        });
    </script>
</body>

</html>
